import { reactive, onMounted, onUnmounted } from "vue"
export default () => {
    const position = reactive({ positionX: 0, positionY: 0 })
    const setPosition = event => {
        position.positionX = event.pageX
        position.positionY = event.pageY
    }
    onMounted(() => {
        window.addEventListener('click', setPosition)
    })

    onUnmounted(() => {
        window.removeEventListener('click', setPosition)
    })

    return position

}